package com.yand.controller.business.classlog;


import com.github.pagehelper.PageInfo;
import com.yand.api.entity.business.classtime.THfClassLog;
import com.yand.api.entity.business.classtime.THfScheduleClass;
import com.yand.api.service.business.classtime.ClassLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 *  上课记录控制器类
 *
 */
@Api(tags = "上课记录控制器类")
@RestController
@RequestMapping("classlog")
public class ClassLogController {


    @Autowired
    private ClassLogService classLogService;

    /**
     *  跳转排课管理列表
     * @param classLog
     * @param model
     * @return
     */
    @ApiOperation("跳转所有的上课记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "classLog", value = "查询所有的上课记录", required = true)
    })
    @GetMapping("/list")
    public ModelAndView list(THfClassLog classLog, Model model){

        ModelAndView modelAndView = new  ModelAndView();
        modelAndView.setViewName("business/classtime/classLog-list");
        PageInfo<THfClassLog> classLogPageInfo = classLogService.queryClassLogList(classLog);
        model.addAttribute("pageInfo",classLogPageInfo);
        model.addAttribute("classlog",classLog);
        return modelAndView;
    }



}
